<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>计算属性简写(前提：只读不改)</title>
    <script src="../js/vue.js"></script>
</head>

<body>
    <div class="app"> 姓：<input type="text" v-model="firstName"><br /> 名：<input type="text" v-model="lastName"><br />
        姓名：<span>{{fullName}}</span>
    </div>
    <script type="text/javascript">

        const vm = new Vue({
            data() {
                return {
                    count: 1,
                    firstName: '测试',
                    lastName: '上海市'
                }
            },
            computed: {
                fullName() {
                    return this.firstName + '-' + this.lastName
                }
            }
        })
        vm.$mount('.app')
    </script>
</body>

</html>